#include "stdafx.h"
#include <iostream>
#include <string>
#include <fstream>
#include <math.h>
#include <stdio.h>
#include <sys/time.h>
#include<condition_variable>
#include <mutex>

using namespace std;



class CMyMDSpi;

class CMyMDApi
{
public:
	CMyMDApi();
	virtual ~CMyMDApi();

	void Init();
	void Destroy();

	void RequestLogin();
	void SubMD(char *instrumentlist[], int instrcount);



public:
	CThostFtdcMdApi * m_pApi;
	CMyMDSpi* m_pSpi;

	//基础api参数输入
	char* m_pszFrontAddr;
	std::string tmp_pszFrontAddr;

	char* m_pszUserId;
	std::string tmp_pszUserId;

	char* m_pszPasswd;
	std::string tmp_pszPasswd;

	char* m_pszBrokerId;
	std::string tmp_pszBrokerId;


	//函数返回值接收变量
	int m_iRequestId;

	//配置文件路径变量
	const char* CfgFilePath;

	//时间统计变量
	struct  timeval starttime;

	//事件控制
	condition_variable cond;
	mutex mu;
	bool serverrt;

};